/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tubosmonterrey.cotizador.tb;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author rsoberanis
 */
@Entity
@Table(name = "tbvendedores")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbvendedores.findAll", query = "SELECT t FROM Tbvendedores t"),
    @NamedQuery(name = "Tbvendedores.findById", query = "SELECT t FROM Tbvendedores t WHERE t.id = :id"),
    @NamedQuery(name = "Tbvendedores.findByNom", query = "SELECT t FROM Tbvendedores t WHERE t.nom = :nom")})
public class Tbvendedores implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "nom")
    private String nom;
    @OneToMany(mappedBy = "vendedor")
    private Collection<Tbclientes> tbclientesCollection;

    public Tbvendedores() {
    }

    public Tbvendedores(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    @XmlTransient
    public Collection<Tbclientes> getTbclientesCollection() {
        return tbclientesCollection;
    }

    public void setTbclientesCollection(Collection<Tbclientes> tbclientesCollection) {
        this.tbclientesCollection = tbclientesCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tbvendedores)) {
            return false;
        }
        Tbvendedores other = (Tbvendedores) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.tubosmonterrey.cotizador.tb.Tbvendedores[ id=" + id + " ]";
    }
    
}
